home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 134 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: ix.netcom.com!netnews
  2. From: tjensen@ix.netcom.com (Ted Jensen)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Defining 2dim array at runtime
  5. Date: Tue, 02 Jan 1996 18:28:59 GMT
  6. Organization: Netcom
  7. Message-ID: <4cbtgh$6o0@ixnews8.ix.netcom.com>
  8. References: <4c4m63$odr@newstand.syr.edu>
  9. Reply-To: tjensen@ix.netcom.com
  10. NNTP-Posting-Host: pax-ca14-11.ix.netcom.com
  11. X-NETCOM-Date: Tue Jan 02 10:28:34 AM PST 1996
  12. X-Newsreader: Forte Free Agent 1.0.82
  13.  
  14. Mohamed Jeragh <maj@top.cis.syr.edu> wrote:
  15.  
  16. >  How can I define a 2 dimensional array at runtime?
  17. >for example, let a be the array
  18. >int **a;
  19. >what will the malloc/calloc statement be? such that I can refer 
  20. >to the array a[i][j] ?
  21.  
  22. There are a variety of ways to do this.  My tutorial on pointers and
  23. arrays covers them all.  It is called ptrtut01.zip and available at
  24. either:
  25.  
  26. http://oak.oakland.edu:8080/SimTel/msdos/c/ptrtut01.zip           
  27.  
  28. or at
  29.  
  30. ftp.coast.net/SimTel/msdos/c/ptrtut01.zip
  31.  
  32. Hope this helps!
  33. Ted-
  34.  
  35.  
  36. Ted Jensen                 Author of PTRTUT01.ZIP
  37. Redwood City, CA      A tutorial on C pointers and Arrays
  38. tjensen@ix.netcom.com    Available via Simtel/msdos/c
  39.  
  40.